--TEST--
MySQLndUhConnection::init(resource $connection)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
	require_once('config.inc');

	class proxy extends MySQLndUhConnection {
		public function init($res) {
			printf("%s(%s)\n", __METHOD__, var_export($res, true));
			/* CAUTION: Userland must call the default implementation. If not, you'll get a crash */
			return parent::init($res);
		}
	}

	class proxy_crash extends MySQLndUhConnection {
		public function init($res) {
			printf("%s(%s)\n", __METHOD__, var_export($res, true));
			/* CAUTION: Crash !! */

		}
	}

	$conn = mysqlnd_uh_test\connect::mysqli();
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new proxy());
	$conn = mysqlnd_uh_test\connect::mysqli();
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new proxy_crash());
	$conn = mysqlnd_uh_test\connect::mysqli();
	print "done!";
?>
--EXPECTF--
proxy::init(NULL)
proxy_crash::init(NULL)

Warning: mysqli_connect(): (MySQLnd User Handler) The method MySQLndUhConnection::init() did not return a boolean value as it should in %s on line %d

Fatal error: mysqli_connect(): (MySQLnd User Handler) The MySQLnd connection handle has not been initialized properly. PHP/MySQLnd will crash. You must always call the init() method from the build-in base class MySQLndUhConnection in %s on line %d